Skip to content

plistutil: preserve binary data on Windows standard streams - #320

Open
Alb3e3 wants to merge 1 commit into
libimobiledevice:masterfrom
Alb3e3:fix/windows-binary-streams
Open

plistutil: preserve binary data on Windows standard streams#320
Alb3e3 wants to merge 1 commit into
libimobiledevice:masterfrom
Alb3e3:fix/windows-binary-streams

Conversation

@Alb3e3

@Alb3e3 Alb3e3 commented Sep 7, 2026

Copy link
Copy Markdown

On Windows, stdin and stdout default to CRT text mode, while named plist files
are opened in binary mode. A valid binary plist containing CR/LF or Ctrl-Z can
therefore fail to parse from stdin; binary output written to stdout can also
gain carriage-return bytes and become invalid.

Set binary mode before reading stdin and before writing converted plist data
to stdout. Add a regression that compares standard-stream conversions with
named-file conversions using a plist containing CR, LF, and Ctrl-Z data bytes.
The test covers explicit and implicit standard streams, pipes, and print mode.

Related to #254. The report does not include its original input, but the new
fixture reproduces its stdin parse error on current master.

Validation: the regression fails before the fix and passes afterward with
MinGW-w64 GCC 12.2 under Wine 8.0. Full Linux make check passes all 43 tests.
Native Windows/MSYS2 execution remains for CI.

Developed with AI assistance; the patch was reviewed and tested locally.

@Alb3e3
Alb3e3 force-pushed the fix/windows-binary-streams branch from 9c21bb4 to 14ebf28 Compare September 7, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant